import request from '@/utils/request'


export function getUserList(data) {
  return request({
    url: 'users',
    method: 'get',
    params:data
  })
}

export function add(data) {
  return request({
    url: 'users',
    method: 'post',
    data,
    msg:true
  })
}

export function del(ids) {
  return request({
    url: 'users/'+ids,
    method: 'delete',
    data: ids,
    msg:true
  })
}
// 编辑获取详情
export function edit(id) {
  return request({
    url: 'users/'+id,
    method: 'get',
  })
}
// 编辑确认
export function editUser(id,data) {
  return request({
    url: 'users/'+id,
    method: 'put',
    data,
    msg:true
  })
}


// 更新密码
export function restPassword(id,data) {
  return request({
    url: 'restPassword/'+id,
    method: 'put',
    data,
    msg:true
  })
}


// 启用/禁用
export function userSwitch(id) {
  return request({
    url: 'users/switch/status/'+id,
    method: 'put',
    msg:true
  })
}

// 上级集合
export function getlevel() {
  return request({
    url: 'level/users',
    method: 'get',
  })
}